#ifndef __GLOBAL_PLANNING_BASE_H_
#define __GLOBAL_PLANNING_BASE_H_

#include <mc_common/base_define.h>
#include <mc_common/msg_convert.h>
#include <mc_common/math_utils.h>
#include <mc_map/map_base.h>

#include <mc_path_planning/path_planning_base.h>

using namespace std;

enum GlobalPlanningType{
    AstarPlanner = 1,
    DstarPlanner = 2
};

class PathPlanningBase : public MapBase{
    public:
        PathPlanningBase();
        ~PathPlanningBase();

        /***************************************
         * path_planning_base.cpp
         ***************************************/
        // 全局路径规划 虚函数接口
        virtual bool PathGenerate(Vec2i start, Vec2i goal, vector<Vec2i>& points) = 0;
        // 路径规划
        bool PathPlanning(Pose2D start, Pose2D goal, vector<Pose2D>& points);

        // 点集转路径
        nav_msgs::Path Points2Path(vector<Vec2f>& points, string frame_id);
        // 路径方向计算
        vector<Pose2D> GenPathDirection(vector<Pose2D>& points, Pose2D goal);


        /***************************************
         * path_smoother.cpp
         ***************************************/
        // 五点梯度下降法 路径平滑
        void PathSmootherFivePoint(vector<Vec2f> src_points, vector<Vec2f>& out_points);
        // 三阶贝塞尔曲线计算 此处暂不使用递归计算n阶
        Vec2f BezierCurve3(const Vec2f& P0, const Vec2f& P1,
             const Vec2f& P2, const Vec2f& P3, float t);
        // 三阶贝塞尔曲线平滑路径
        void PathSmootherBezierCurve3(vector<Vec2f> src_points, vector<Vec2f>& out_points);

    private:
        ros::NodeHandle nh_;
        ros::Publisher pathPub_;
        ros::Publisher pathOriginPub_;
        ros::Publisher startPosePub_;
        ros::Publisher goalPosePub_;
};

#endif